-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 01, 2009 at 01:14 PM
-- Server version: 5.1.37
-- PHP Version: 5.3.0

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `infocorp`
--

-- --------------------------------------------------------

--
-- Table structure for table `product`
--

CREATE TABLE IF NOT EXISTS `product` (
  `ProductID` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(100) NOT NULL,
  `Cost` float NOT NULL,
  PRIMARY KEY (`ProductID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;

--
-- Dumping data for table `product`
--

INSERT INTO `product` (`ProductID`, `Name`, `Cost`) VALUES
(1, 'Product 1', 10),
(2, 'product 2', 3),
(3, 'Product 3', 11),
(4, 'Product 4', 15),
(5, 'Product 5', 6),
(6, 'Product 6', 4),
(7, 'product 7', 5),
(8, 'product 8', 6),
(9, 'product 9', 5),
(10, 'product 10', 9),
(11, 'product 11', 10);

-- --------------------------------------------------------

--
-- Table structure for table `region`
--

CREATE TABLE IF NOT EXISTS `region` (
  `RegionID` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(100) NOT NULL,
  PRIMARY KEY (`RegionID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;

--
-- Dumping data for table `region`
--

INSERT INTO `region` (`RegionID`, `Name`) VALUES
(1, 'North'),
(2, 'South'),
(3, 'East'),
(4, 'West'),
(5, 'Central');

-- --------------------------------------------------------

--
-- Table structure for table `salesorder`
--

CREATE TABLE IF NOT EXISTS `salesorder` (
  `SalesOrderID` int(11) NOT NULL AUTO_INCREMENT,
  `ProductID` int(11) NOT NULL,
  `SalesPersonID` int(11) NOT NULL,
  `OrderQty` int(11) NOT NULL,
  `OrderDate` date NOT NULL,
  PRIMARY KEY (`SalesOrderID`),
  KEY `ProductID` (`ProductID`),
  KEY `SalesPersonID` (`SalesPersonID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

--
-- Dumping data for table `salesorder`
--

INSERT INTO `salesorder` (`SalesOrderID`, `ProductID`, `SalesPersonID`, `OrderQty`, `OrderDate`) VALUES
(1, 1, 1, 20, '2009-01-08'),
(2, 2, 1, 45, '2009-02-11'),
(3, 3, 1, 34, '2008-03-16');

-- --------------------------------------------------------

--
-- Table structure for table `salesperson`
--

CREATE TABLE IF NOT EXISTS `salesperson` (
  `SalesPersonID` int(11) NOT NULL AUTO_INCREMENT,
  `RegionID` int(11) NOT NULL,
  `Name` varchar(100) NOT NULL,
  `Address` text NOT NULL,
  `Email` varchar(100) NOT NULL,
  PRIMARY KEY (`SalesPersonID`),
  KEY `RegionID` (`RegionID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;

--
-- Dumping data for table `salesperson`
--

INSERT INTO `salesperson` (`SalesPersonID`, `RegionID`, `Name`, `Address`, `Email`) VALUES
(1, 1, 'Rajiv Turkar', 'North America', 'rajiv.turkar@gmail.com'),
(2, 2, 'Ramesh Shinde', 'South America', 'ramesh.shinde@gmail.com'),
(3, 3, 'Sheetal Umrani', 'East America', 'sheetal.umrani@gmail.com'),
(4, 4, 'Sourabh Kulkarni', 'West US', 'Sourabh_Kulkarni@gmail.com'),
(5, 5, 'Sameer Awate', 'Central US', 'Sameer_Awate@gmail.com');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `salesorder`
--
ALTER TABLE `salesorder`
  ADD CONSTRAINT `salesorder_ibfk_1` FOREIGN KEY (`ProductID`) REFERENCES `product` (`ProductID`) ON DELETE CASCADE ON UPDATE NO ACTION,
  ADD CONSTRAINT `salesorder_ibfk_2` FOREIGN KEY (`SalesPersonID`) REFERENCES `salesperson` (`SalesPersonID`) ON DELETE CASCADE ON UPDATE NO ACTION;

--
-- Constraints for table `salesperson`
--
ALTER TABLE `salesperson`
  ADD CONSTRAINT `salesperson_ibfk_1` FOREIGN KEY (`RegionID`) REFERENCES `region` (`RegionID`) ON DELETE CASCADE ON UPDATE NO ACTION;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
